Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump posthog version to 3.25 #7793

Merged
merged 3 commits into from
May 31, 2024
Merged

Conversation

BillCarsonFr
Copy link
Member

Fixes https://github.com/element-hq/crypto-internal/issues/314

Updated posthog library to 3.2.5 in order to benefit from per session grouping.
I had to move out Posthog from cocoapod and use swiftPM instead, was getting an error on posthog via cocoapod see here

There are some changes with the new Posthog SDK, main one is around setting userProperties that has dedicated API now (no need to manually put the $set), updated the test.

There are some things I am not sure should be commited, like the Package.resolved change on swift-collections or the COCOAPODS version change in the lock file. Let me know how to handle that.

Pull Request Checklist

  • I read the contributing guide
  • UI change has been tested on both light and dark themes, in portrait and landscape orientations and on iPhone and iPad simulators
  • Accessibility has been taken into account.
  • Pull request is based on the develop branch
  • Pull request contains a changelog file in ./changelog.d
  • You've made a self review of your PR
  • Pull request includes screenshots or videos of UI changes
  • Pull request includes a sign off

Copy link

codecov bot commented May 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 12.33%. Comparing base (1ccf0b6) to head (cf3dcca).
Report is 15 commits behind head on develop.

Current head cf3dcca differs from pull request most recent head e1b9bbb

Please upload reports for the commit e1b9bbb to get more accurate results.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #7793      +/-   ##
===========================================
+ Coverage    12.27%   12.33%   +0.06%     
===========================================
  Files         1651     1651              
  Lines       164171   163960     -211     
  Branches     67502    67314     -188     
===========================================
+ Hits         20148    20232      +84     
+ Misses      143350   143091     -259     
+ Partials       673      637      -36     
Flag Coverage Δ
uitests 55.65% <ø> (+0.63%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


/// Any user properties to be included with the next captured event.
private(set) var pendingUserProperties: AnalyticsEvent.UserProperties?

static let shared = PostHogAnalyticsClient()

var isRunning: Bool { postHog?.enabled ?? false }
var isRunning: Bool { postHog != nil }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can use the isOptOut method

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if lot better? would be a not isOptOut() and as it's optional could be a bit harder to read.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

postHog can be not nil and is still internally disabled, so isOptOut is the method to call.
!isOptOut() == enabled
isOptOut() == disabled.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated, let me know if ok for you

Copy link
Member

@pixlwave pixlwave left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, nice simplification here :)

@BillCarsonFr BillCarsonFr force-pushed the valere/bump_posthog_version_3 branch from 564762a to e1b9bbb Compare May 31, 2024 13:54
Copy link

sonarcloud bot commented May 31, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@BillCarsonFr BillCarsonFr merged commit fddd6e2 into develop May 31, 2024
5 checks passed
@BillCarsonFr BillCarsonFr deleted the valere/bump_posthog_version_3 branch May 31, 2024 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants